home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume7 / xmeter / patch1 next >
Encoding:
Internet Message Format  |  1990-05-12  |  4.4 KB

  1. Path: uunet!samsung!munnari.oz.au!metro!sunaus.oz!newstop!sun!rand.org
  2. From: bobs%moose@rand.org (Robert Schwartzkopf)
  3. Newsgroups: comp.sources.x
  4. Subject: v07i034: xmeter - Display rstat statistics for X11R4, Patch1, Part01/01
  5. Message-ID: <135597@sun.Eng.Sun.COM>
  6. Date: 12 May 90 07:52:55 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 149
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: Robert Schwartzkopf <bobs%moose@rand.org>
  12. Posting-number: Volume 7, Issue 34
  13. Archive-name: xmeter/patch1
  14. Patch-To: xmeter: Volume 6, Issue 98
  15.  
  16. Changes in patch 1 include plugging a memory leak and cleaning up my
  17. Imakefile a little.  I've also included a README file that should have been
  18. included in the original posting.
  19.  
  20. Bob Schwartzkopf (bobs@rand.org)
  21.  
  22. #    This is a shell archive.
  23. #    Remove everything above and including the cut line.
  24. #    Then run the rest of the file through sh.
  25. #----cut here-----cut here-----cut here-----cut here----#
  26. #!/bin/sh
  27. # shar:    Shell Archiver
  28. #    Run the following text with /bin/sh to create:
  29. #    README
  30. #    patch1
  31. # This archive created: Fri May  4 16:36:11 1990
  32. cat << \SHAR_EOF > README
  33. xmeter displays a histogram of data returned by rstat(3).  It can be
  34. told to monitor multiple hosts, or to monitor multiple statistics on the
  35. same host.  Known to run on sun3s and sun4s running SunOS 4.0.3 under
  36. X11 R4.
  37.  
  38. Author: Bob Schwartzkopf (bobs@rand.org)
  39.     The RAND Corporation
  40.     1700 Main Street
  41.     Santa Monica, CA 90406-2138
  42. SHAR_EOF
  43. if test 331 -ne "`wc -c README`"
  44. then
  45. echo shar: error transmitting README '(should have been 331 characters)'
  46. fi
  47. cat << \SHAR_EOF > patch1
  48. Prereq: 0
  49. *** /tmp/,RCSt1a12217    Fri May  4 16:31:31 1990
  50. --- patchlevel.h    Fri May  4 12:37:00 1990
  51. ***************
  52. *** 1 ****
  53. ! #define PATCHLEVEL 0
  54. --- 1 ----
  55. ! #define PATCHLEVEL 1
  56. *** /tmp/,RCSt1a12220    Fri May  4 16:31:32 1990
  57. --- xmeter.c    Fri May  4 12:33:56 1990
  58. ***************
  59. *** 8,13 ****
  60. --- 8,29 ----
  61.    * to run under X11 R4 on sun3s and sun4s running SunOS 4.0.3.
  62.    */
  63.   
  64. + #ifndef lint
  65. + static char    *RCSid="$Header: /a/moose/lhome/src/rand/xmeter/RCS/xmeter.c,v 1.2 90/05/04 12:31:52 bobs Exp $";
  66. + #endif lint
  67. + /*
  68. +  * $Log:    xmeter.c,v $
  69. +  * Revision 1.2  90/05/04  12:31:52  bobs
  70. +  * Fix memory leak in getport().  Wasn't freeing resources allocated by
  71. +  * clntudp_create when clnt_call failed.  Also removed explicit calls
  72. +  * to close sockets since clnt_destroy() does this.
  73. +  * 
  74. +  * Revision 1.1  90/04/30  14:33:59  bobs
  75. +  * Initial revision
  76. +  * 
  77. +  */
  78.   #include <stdio.h>
  79.   #include <sys/time.h>
  80.   #include <sys/param.h>
  81. ***************
  82. *** 554,563 ****
  83.             return (-1);
  84.             sh->s = RPC_ANYSOCK;
  85.             if (!(sh->clnt = clntudp_create (&sh->addr, RSTATPROG, RSTATVERS,
  86. !                       ptto, &sh->s))) {
  87. !           close (sh->s);
  88.             return (-1);
  89. -           }
  90.         ost = NULL;
  91.             sh->idx = 0;
  92.         } else {
  93. --- 570,577 ----
  94.             return (-1);
  95.             sh->s = RPC_ANYSOCK;
  96.             if (!(sh->clnt = clntudp_create (&sh->addr, RSTATPROG, RSTATVERS,
  97. !                       ptto, &sh->s)))
  98.             return (-1);
  99.         ost = NULL;
  100.             sh->idx = 0;
  101.         } else {
  102. ***************
  103. *** 568,574 ****
  104.                 &sh->st[sh->idx], tto);
  105.         if (cs != RPC_SUCCESS) {
  106.             clnt_destroy (sh->clnt);
  107. -           close (sh->s);
  108.             sh->clnt = NULL;
  109.             return (-1);
  110.         }
  111. --- 582,587 ----
  112. ***************
  113. *** 596,607 ****
  114.     if (!(c = clntudp_create (&sh->addr, PMAPPROG, PMAPVERS, ptto, &sh->s)))
  115.         return (-1);
  116.     cs = clnt_call (c, PMAPPROC_GETPORT, xdr_pmap, &pm, xdr_u_short, &p, tto);
  117. !   close (sh->s);
  118. !   if (cs == RPC_SUCCESS) {
  119. !       clnt_destroy (c);
  120. !       return (p);
  121. !   } else
  122. !       return (-1);
  123.   }
  124.   
  125.   /*
  126. --- 609,616 ----
  127.     if (!(c = clntudp_create (&sh->addr, PMAPPROG, PMAPVERS, ptto, &sh->s)))
  128.         return (-1);
  129.     cs = clnt_call (c, PMAPPROC_GETPORT, xdr_pmap, &pm, xdr_u_short, &p, tto);
  130. !   clnt_destroy (c);
  131. !   return (cs == RPC_SUCCESS ? p : -1);
  132.   }
  133.   
  134.   /*
  135. *** /tmp/,RCSt1a12223    Fri May  4 16:31:33 1990
  136. --- Imakefile    Mon Apr 30 14:41:02 1990
  137. ***************
  138. *** 3,8 ****
  139.     SYS_LIBRARIES = -lrpcsvc
  140.              SRCS = xmeter.c
  141.              OBJS = xmeter.o
  142. -     CDEBUGFLAGS = -O
  143.   
  144.   ComplexProgramTarget(xmeter)
  145. --- 3,7 ----
  146. SHAR_EOF
  147. if test 2662 -ne "`wc -c patch1`"
  148. then
  149. echo shar: error transmitting patch1 '(should have been 2662 characters)'
  150. fi
  151. #    End of shell archive
  152. exit 0
  153.  
  154. dan
  155. ----------------------------------------------------
  156. O'Reilly && Associates   argv@sun.com / argv@ora.com
  157. Opinions expressed reflect those of the author only.
  158.